import { dataDispose } from '../../assets/comFun'
//导航栏icon
import { DatabaseOutlined } from "@ant-design/icons";
import FeedBack from '../../assets/image/icon/feedBack.png';

//代办事项
import TodoList from './TodoList/TodoList'
//我的审批
import MyApproval from './MyApproval/MyApproval'
//我的审批 -- 添加申请单
import FinancialApplyForm from './MyApproval/FinancialApplyForm'

//财务报表
// import FinanceForm from './FinanceForm'
//财务设置 -- 财务审批设置
// import FinanceApprovalSet from './FinanceApprovalSet'
//我的审批详情
import MyApprovalDetails from './MyApproval/MyApprovalDetails'

//费用申请按钮页面
import AddMoneyApply from './AddMoneyApply'
//费用申请页面
import MoneyApplyForm from './AddMoneyApply/MoneyApplyForm'
// //费用收缴 -- 应收/实收
// import ActualMoney from './CostCapture/ActualMoney'
// //费用收缴 -- 保证金/押金
// import EarnestMoney from './CostCapture/EarnestMoney'
//费用反馈-- 费用确认
import FinanceFeedBackOk from './FinanceFeedBack/FinanceFeedBackOk';
//费用反馈-- 反馈列表
import FinanceFeedBackList from './FinanceFeedBack/FinanceFeedBackList';
//费用反馈 -- 反馈列表详情页
import FinanceFeedBackDetails from './FinanceFeedBack/FinanceFeedBackDetails';
//费用反馈 -- 费用反馈列表 -- 添加反馈
import AddFinanceFeedBackAll from './FinanceFeedBack/AddFinanceFeedBack';
//内部交易 -- 材料交易单
import MaterialTransactionSheet from './InternalTransactions/MaterialTransactionSheet';
//内部交易 -- 生产交易单
import ProductTransactionSheet from './InternalTransactions/ProductTransactionSheet';
//内部交易 -- 人工成本
import ManualAllocation from './InternalTransactions/ManualAllocation';
//内部交易 -- 机会成本分配单
import OpportunityCost from './InternalTransactions/OpportunityCost';

/**
 * @description: 费用管理 - 路由
 * @author: xiaoxujs
 * @updata: xiaoxujs（2021-09-07）增加权限
 * @updata: xiaoxujs（2021-09-17）添加反馈
 */


//侧边栏数据
const menuFinancial = [
    {
        key: 'addMoneyApply',
        meta: {
            title: "费用申请",
            icon: <DatabaseOutlined />,
        },
        authority: 'FYSQ',
        path: "/addMoneyApply",
        component: AddMoneyApply,
    },
    {
        key: 'todoList',
        meta: {
            title: "待办事项",
            icon: <DatabaseOutlined />,
        },
        authority: 'DBSX',
        path: "/todoListAll",
        component: TodoList,
        page: [
            {
                key: 'todoListAll',
                meta: {
                    title: "全部",
                    icon: <DatabaseOutlined />,
                },
                authority: 'ALL',
                path: "/todoListAll",
                component: TodoList,
            },
            {
                key: 'todoListMy',
                meta: {
                    title: "待审批",
                    icon: <DatabaseOutlined />,
                },
                authority: 'DSP_FY',
                path: "/todoListMy",
                component: TodoList,
            },
            {
                key: 'todoListMyOver',
                meta: {
                    title: "已审批",
                    icon: <DatabaseOutlined />,
                },
                authority: 'YSP_FY',
                path: "/todoListMyOver",
                component: TodoList,
            },
            {
                key: 'todoListHangUp',
                meta: {
                    title: "挂起",
                    icon: <DatabaseOutlined />,
                },
                authority: 'GQ_FY',
                path: "/todoListHangUp",
                component: TodoList,
            }
        ],
    },
    {
        key: 'myApproval',
        meta: {
            title: "我的审批",
            icon: <DatabaseOutlined />,
        },
        authority: 'WDSP_FY',
        path: "/myApproval",
        component: MyApproval,
        page: [
            {
                key: 'myApprovalAll',
                meta: {
                    title: "全部",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_ALL',
                path: "/myApprovalAll",
                component: MyApproval,
            },
            {
                key: 'myApprovalAwait',
                meta: {
                    title: "待审批",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_DSP',
                path: "/myApprovalAwait",
                component: MyApproval,
            },
            {
                key: 'myApprovalOk',
                meta: {
                    title: "审批通过",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_PAS',
                path: "/myApprovalOk",
                component: MyApproval,
            },
            {
                key: 'myApprovalNo',
                meta: {
                    title: "审批失败",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_FUL',
                path: "/myApprovalNo",
                component: MyApproval,
            },
            {
                key: 'myApprovalConcal',
                meta: {
                    title: "撤销审批",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_CX',
                path: "/myApprovalConcal",
                component: MyApproval,
            }
        ],
    },
    {
        key: 'financeFeedBack',
        meta: {
            title: "费用反馈",
            icon: <span className="icon iconfont" style={{ marginRight: '10px' }}>&#xe738;</span>,
        },
        authority: 'WDSP_FY',
        path: "/financeFeedBackList",
        component: FinanceFeedBackList,
        page: [
            {
                key: 'financeFeedBackList',
                meta: {
                    title: "反馈列表",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_DSP',
                path: "/financeFeedBackList",
                component: FinanceFeedBackList,
            },
            {
                key: 'financeFeedBackOk',
                meta: {
                    title: "反馈确认",
                    icon: <DatabaseOutlined />,
                },
                authority: 'WD_ALL',
                path: "/financeFeedBackOk",
                component: FinanceFeedBackOk,
            }
        ],
    },
    {
        key: 'internalTransactions',
        meta: {
            title: '内部交易',
            icon: <span className="icon iconfont" style={{ marginRight: '10px' }}>&#xe67f;</span>,
        },
        authority: 'WDSP_FY',
        path: '/internalTransactions/materialTransactionSheet',
        component: MaterialTransactionSheet,
        page: [
            {
                key: 'materialTransactionSheet',
                meta: {
                    title: '材料交易单',
                    icon: <img src={FeedBack} alt='费用反馈icon' style={{ margin: '-4px 10px 0 0' }} />,
                },
                authority: 'WDSP_FY',
                path: '/internalTransactions/materialTransactionSheet',
                component: MaterialTransactionSheet,
            },
            {
                key: 'productTransactionSheet',
                meta: {
                    title: '生产交易单',
                    icon: <img src={FeedBack} alt='费用反馈icon' style={{ margin: '-4px 10px 0 0' }} />,
                },
                authority: 'WDSP_FY',
                path: '/internalTransactions/productTransactionSheet',
                component: ProductTransactionSheet,
            },
            {
                key: 'manualAllocation',
                meta: {
                    title: '人工成本分配单',
                    icon: <img src={FeedBack} alt='费用反馈icon' style={{ margin: '-4px 10px 0 0' }} />,
                },
                authority: 'WDSP_FY',
                path: '/internalTransactions/manualAllocation',
                component: ManualAllocation,
            },
            {
                key: 'OpportunityCost',
                meta: {
                    title: '机会成本分配单',
                    icon: <img src={FeedBack} alt='费用反馈icon' style={{ margin: '-4px 10px 0 0' }} />,
                },
                authority: 'WDSP_FY',
                path: '/internalTransactions/opportunityCost',
                component: OpportunityCost,
            },
        ]
    }
    // {
    //     key: 'costCapure',
    //     meta: {
    //         title: "费用收缴",
    //         icon: <DatabaseOutlined />,
    //     },
    //     path: "/actualMoney",
    //     component: ActualMoney,
    //     page: [
    //         {
    //             key: 'actualMoney',
    //             meta: {
    //                 title: "应收/实收",
    //                 icon: <DatabaseOutlined />,
    //             },
    //             path: "/actualMoney",
    //             component: ActualMoney,
    //         },
    //         {
    //             key: 'earnestMoney',
    //             meta: {
    //                 title: "保证金/押金",
    //                 icon: <DatabaseOutlined />,
    //             },
    //             path: "/earnestMoney",
    //             component: EarnestMoney,
    //         }
    //     ],
    // },
    // {
    //     key: 'financeForm',
    //     meta: {
    //         title: "费用报表",
    //         icon: <DatabaseOutlined />,
    //     },
    //     authority: 'GQ_FY',
    //     path: "/financeForm",
    //     component: FinanceForm
    // },
    // {
    //     key: 'financeApprovalSet',
    //     meta: {
    //         title: "费用审批设置",
    //         icon: <DatabaseOutlined />,
    //     },
    //     path: "/financeApprovalSet",
    //     component: FinanceApprovalSet
    // }
];
//侧边栏数据转成路由
let menuLeftFinancialRouterPage = dataDispose(menuFinancial);

const financialManagementPage = [
    {
        path: "/financialApplyForm",
        component: FinancialApplyForm,
    },
    {
        path: "/myApproval/details",
        component: MyApprovalDetails,
    },
    {
        path: '/moneyApplyForm',
        component: MoneyApplyForm
    },
    {
        path: '/financeFeedBack/details',
        component: FinanceFeedBackDetails
    },
    {
        path: '/add/financeFeedBackAll',
        component: AddFinanceFeedBackAll
    }
]

export {
    menuFinancial,
    menuLeftFinancialRouterPage,
    financialManagementPage
}